package com.yunshang.shoppingmall.common;

import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class VerifyData {

    //验证手机号
    public static boolean getVerifyPhone(String phone){
        Map<String,Object> map =new HashMap<>();
        String regex = "^((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(166)|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[8|9]))\\d{8}$";
        if(!phone.isEmpty()&&phone.length()==11){
            Pattern p = Pattern.compile(regex);
            Matcher m = p.matcher(phone);
            boolean isMatch = m.matches();
            if(isMatch){
             return  true;
            }else {

                return false;
            }
        }else {
            return  false;
        }

    }


}
